package com.zmkj.cn.sys.controller;

import com.zmkj.cn.sys.service.IUploadService;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * 微信模版消息推送
 *
 * @author 伍绍宇
 * @date 2021/04/29
 */
@RestController
@RequestMapping("/busLocalFile")
public class UploadController {

    @Resource
    private IUploadService uploadService;

    /**
     * 上传
     *
     * @author 伍绍宇
     * @date 2021/06/04
     */
    @PostMapping("/upload")
    public Object transferTemplate(@ModelAttribute MultipartFile file, HttpServletRequest request) {
        return uploadService.upload(file, request);
    }

}
